<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增定时任务')" />
	<th:block th:include="include :: cronGen-css" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-job-add">
		    <input type="hidden" name="createBy" th:value="${@permission.getPrincipalProperty('name')}">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">任务类名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="jobClassName" id="jobClassName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">cron表达式：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="cronExpression" id="cronExpression" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">参数：</label>
				<div class="col-sm-8">
					<textarea id="parameter" name="parameter" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">描述：</label>
				<div class="col-sm-8">
					<textarea id="description" name="description" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">状态：</label>
				<div class="col-sm-8">
				    <div class="radio-box" th:each="dict : ${@dict.getType('quartz_status')}">
						<input type="radio" th:id="${dict.id}" name="status" th:value="${dict.itemValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
						<label th:for="${dict.id}" th:text="${dict.itemText}"></label>
					</div>
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: cronGen-js" />
	<script type="text/javascript">
		var prefix = ctx + "sys/quartzJob";

		$("#form-job-add").validate({
	        focusCleanup: true
		});

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/add", $('#form-job-add').serialize());
	        }
	    }

		$("#cronExpression").cronGen({
			direction : 'bottom'
		})
	</script>
</body>
</html>
